package com.example.zluserservice.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * @Author zhenliu（孙凌岳）
 * @Description TODO
 * @Date 2025/6/17 15:59
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@TableName("sys_user_role")
public class UserRole {
    /**
     * 数据状态（0正常 1停用）
     */
    private String dataState;

    /**
     * 角色ID
     */
    private Long roleId;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    public Long id;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public LocalDateTime createTime;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public LocalDateTime updateTime;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private Long createBy;

    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    private Long updateBy;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remark;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private String creator;

    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    private String updater;

    /**
     * 请求参数 (JsonIgnore is used to exclude it from Swagger docs)
     */
    @JsonIgnore
    private Map<String, Object> params;

    @Builder
    public UserRole(String dataState, Long roleId, Long userId, Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createBy, Long updateBy, String remark, String creator, String updater, Map<String, Object> params) {
        this.dataState = dataState;
        this.roleId = roleId;
        this.userId = userId;
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createBy = createBy;
        this.updateBy = updateBy;
        this.remark = remark;
        this.creator = creator;
        this.updater = updater;
        this.params = params;
    }
}
